package chapter18;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/24 21:55
 */
public class BufferedInputFile {
    public static String read(String filename) throws IOException {
        BufferedReader in = new BufferedReader(new FileReader(filename));
        String s;
        StringBuilder builder = new StringBuilder();
        while ((s = in.readLine()) != null) {
            builder.append(s).append("\n");
        }
        in.close();
        return builder.toString();
    }
}
